﻿<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <script src="../../js/load.js"></script>
</head>

<body>
    <div id="container">
        <div id="formcontainer">
            <form class="layui-form layui-form-pane" id="editform" lay-filter="editform">
                <div class="layui-row">
                    <div class="layui-col-xs12">
                        <div class="layui-form-item">
                            <label class="layui-form-label">版本名称</label>
                            <div class="layui-input-block">
                                <input type="text" name="versionName" autocomplete="off" class="layui-input" disabled>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-row">
                    <div class="layui-col-xs12">
                        <div class="layui-form-item">
                            <label class="layui-form-label">版本路径</label>
                            <div class="layui-input-block">
                                <input type="text" name="versionPath" autocomplete="off" class="layui-input" disabled>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-row">
                    <div class="layui-col-xs12">
                        <div class="layui-form-item" pane="">
                            <label class="layui-form-label required">强制保留</label>
                            <div class="layui-input-block">
                                <input type="radio" name="forceKeep" value="1" title="是" checked>
                                <input type="radio" name="forceKeep" value="0" title="否">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-row">
                    <div class="layui-col-xs12">
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">备注</label>
                            <div class="layui-input-block">
                                <textarea name="versionRemark" autocomplete="off" class="layui-textarea"></textarea>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
        <div id="opcontainer">
            <button class="layui-btn" onclick="HandleSave()">确认</button>
            <button class="layui-btn layui-btn-primary" onclick="HandleClose()">关闭</button>
        </div>
    </div>
</body>
<script>
    var FormDetail = null;
    $(function () {
        LoadDetail();
    })

    function LoadDetail() {
        var param = {
            versionID: GetUrlParam("versionID")
        }
        SetForm("editform", "api/depolyversion/detail", param, function (data) {
            FormDetail = data;
        })
    }

    function HandleSave() {
        SubmitForm('editform', "api/depolyversion/update", BeforeSubmit, FormDetail, function (result, status) {
            if (result.code == 0) {
                OpenSuccess('保存成功', function (params) {
                    CloseDialog();
                })

            } else {
                OpenFail(result.msg);
            }
        })
    }

    function BeforeSubmit(data) {
        return true;
    }


    function HandleClose() {
        CloseDialog();
    }
</script>

</html>